package br.com.hbt.expressaoregular.formula;

import java.util.HashMap;
import java.util.Map;

public class Contexto {

    private HashMap<String, Double> mapParam = new HashMap<String, Double>();

    public void atribui(String var, double value) {
        mapParam.put(var, new Double(value));
    }

    public double getValor(String var) {
        Double objDouble = mapParam.get(var);
        return objDouble.doubleValue();
    }

    public Contexto() {
        mapParam.put("z", (double) 0);
    }

    public Contexto(Map<String, Double> parametros) {
        mapParam = (HashMap<String, Double>) parametros;
        mapParam.put("z", (double) 0);
    }

    public HashMap<String, Double> getMapParam() {
        return mapParam;
    }

}
